﻿<!-- #include file="cjf.asp" -->
<!--#include file="conn.asp"-->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>下载图片</title>
    <style>
        body
        {
            font-size: 9pt;
            line-height: 140%;
        }
    </style>
</head>
<body>
    <%
set rs=server.createobject("adodb.recordset")
set rsm=server.createobject("adodb.recordset")
id=request("id")
rs.open "select * from zj where id="&request("id"),conn,1,1
     if not rs.eof then
	 id=rs("id")
	 cid=rs("cid")
       comic_name=""
       zjid=rs("id")
	   zjmc=rs("zjmc")
	   tpadd=rs("tpadd")
	   tpurl=rs("tpurl")
	   tpf=rs("tpf")
	   tps=rs("tps")
	   add_date=rs("adddate")
	    hits=rs("hits")
		cjitemid=rs("cjitemid")
	   datetime=year(rs("adddate"))&"-"&month(rs("adddate"))&"-"&day(rs("adddate"))
	 end if
   rs.close    
rs.open "select * from comics where id="&cid,conn,1,1
if not rs.eof then
comic_name=rs("mhmc")
 end if
   rs.close  
rs.open "select * from zjlog where id="&cjitemid,conn,1,1
if not rs.eof then
cjwebid=rs("cjwebid")
 end if
   rs.close 

rs.open "select * from cjxm where id="&cjwebid,conn,1,1
if not rs.eof then
zjtpsurl=rs("zjtpsurl")
xmfd=rs("xmfd")
end if
rs.close 
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.folderexists(server.mappath("../comicdata/"&cid&"\"&foldername))=false then
Fso.Createfolder(server.mappath("../comicdata/"&cid&"\"&foldername))
end if
if fso.folderexists(server.mappath("../comicdata/"&cid&"/"&zjmc&"\"&foldername))=false then
Fso.Createfolder(server.mappath("../comicdata/"&cid&"/"&zjmc&"\"&foldername))

end if
tpurl2=Split(tpurl,"|")
for i=0 to  ubound(tpurl2)-1
imgurl=tpurl2(i)
zjtpurl=zjtpsurl&imgurl
if xmfd=true then
getPICurl=""&web_url&"/inc/picpj.asp?url="&zjtpurl
else
getPICurl=""&zjtpurl&""
end if
savepath="../comicdata/"&cid&"/"&zjmc&"/"&i+1&".jpg"
if fso.FileExists(server.mappath(savepath))=false then
Response.write "<br>下载图片：<font color=blue><a href="&zjtpurl&" target=_blank>"&zjtpurl&"</a></font> 保存为：<font color=red>"&savepath&"</font>"
call saveimg(getPICurl,savepath)
else
Response.write "<br>下载图片：<font color=blue>"&savepath&"图片存在，已跳过"
end if

next



if request("type")="page" then%><font color="#FF0000">下载图片完成</font><script language="JavaScript">
<!--
                                                                       setTimeout('window.close();', 500);
// -->
</script>
    <%end if%>
</body>
</html>
